package com.ywj.collection.MyMap;

public class MyMapTableSize {
    public static void main(String[] args) {
        int INITIAL_CAPACITY = 1 << 4, MAXIMUM_CAPACITY = 1 << 30;;
        int n = INITIAL_CAPACITY - 1;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        int result = (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
        System.out.println(INITIAL_CAPACITY + "  " + n + "  " + result);
    }
}
